package cn.java.demo;

public class JStruct
{
    public JStruct next=null;
    public int data;
}

class LinkListDemo
{
    public static void main(String[] args)
    {
        JStruct head=null,last=null,item=null;
        for (int i = 0; i < 10; i++)
        {
            item=new JStruct();
            item.data=i;
            if(i==0) head=item;
            else
            {
                last.next=item;
            }
            last=item;
        }

        item=head;
        while (item != null)
        {
            System.out.println(item.data);
            item=item.next;
        }

    }
}
